home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / amigaoscd / amigapluscd / AP-Website / forum / wbboard / profile.php < prev    next >
PHP Script  |  2001-08-03  |  24KB  |  419 lines

  1. <?
  2. require("_functions.php");
  3.  
  4. if($user_id) {
  5.         require("_header.php");
  6.         require("_board_jump.php");
  7.         
  8.         if($mode == "avatars") {
  9.             if($send == "send") {
  10.                 if($avatarid!="useown") {
  11.                     $oldavatar = $db_zugriff->query_first("SELECT * FROM bb".$n."_avatars WHERE userid = '$user_id'");
  12.                     if($oldavatar[id]) {
  13.                         @unlink("images/avatars/avatar-".$oldavatar[id].".".$oldavatar[extension]);
  14.                         $db_zugriff->query("DELETE FROM bb".$n."_avatars WHERE id = '$oldavatar[id]'");
  15.                     }
  16.                     $db_zugriff->query("UPDATE bb".$n."_user_table SET avatarid = '$avatarid' WHERE userid = '$user_id'");
  17.                 }
  18.                 else {
  19.                     if($uploadfile) {
  20.                         $oldavatar = $db_zugriff->query_first("SELECT * FROM bb".$n."_avatars WHERE userid = '$user_id'");
  21.                         if($oldavatar[id]) {
  22.                             @unlink("images/avatars/avatar-".$oldavatar[id].".".$oldavatar[extension]);
  23.                                    $db_zugriff->query("DELETE FROM bb".$n."_avatars WHERE id = '$oldavatar[id]'");
  24.                         }
  25.                                $conf[avatar_size] = $avatar_size;
  26.                                $conf[avatar_width] = $avatar_width;
  27.                                $conf[avatar_height] = $avatar_height;
  28.                                $setuserid = $user_id;
  29.                                        
  30.                         $mimetype = explode("\n", $avatarimage_ext);
  31.                     for($i = 0; $i < count($mimetype); $i++) $mimetype[$i] = trim($mimetype[$i]); 
  32.         
  33.                     require_once("./admin/Upload.class.php");
  34.                     $upload = new Upload();
  35.         
  36.                     $upload->setAllowedMimeTypes($mimetype);    
  37.                     $upload->setUploadPath("images/avatars");
  38.     
  39.                     if ($upload->doUpload()) $db_zugriff->query("UPDATE bb".$n."_user_table set avatarid = '$insertid' WHERE userid = '$user_id'");
  40.                     else eval ("\$error = \"".gettemplate("error3")."\";");
  41.                     
  42.                 }
  43.                     elseif(!$havatarid) eval ("\$error = \"".gettemplate("error3")."\";");
  44.             }
  45.             }
  46.             $info = $db_zugriff->query_first("SELECT userposts, avatarid FROM bb".$n."_user_table WHERE userid = '$user_id'");
  47.             if(!$info[avatarid] || !$avatars) $checked = " CHECKED";
  48.             if($avatars) {
  49.             
  50.                 $anzahl = $db_zugriff->query_first("SELECT COUNT(*) FROM bb".$n."_avatars WHERE (groupid = '$user_group' OR groupid = 0) AND posts <= '$info[userposts]' AND userid = 0");
  51.                 if($anzahl[0]) {
  52.                     if(!$page) $page=1;
  53.                     $pages=ceil($anzahl[0]/25);
  54.                 $result = $db_zugriff->query("SELECT * FROM bb".$n."_avatars WHERE (groupid = '$user_group' OR groupid = 0) AND posts <= '$info[userposts]' AND userid = 0 ORDER BY name ASC LIMIT ".(25*($page-1)).", 25");
  55.                     while($row = $db_zugriff->fetch_array($result)) {
  56.                         if($row[id]==$info[avatarid]) $avatarArray[] = "<input type=\"RADIO\" name=\"avatarid\" value=\"$row[id]\" CHECKED><img src=\"images/avatars/avatar-".$row[id].".".$row[extension]."\">";
  57.                         else $avatarArray[] = "<input type=\"RADIO\" name=\"avatarid\" value=\"$row[id]\"><img src=\"images/avatars/avatar-".$row[id].".".$row[extension]."\">";
  58.                     }
  59.                     $tableRows = ceil(count($avatarArray)/5);
  60.                     $count = 0;
  61.                     for ($i=0; $i<$tableRows; $i++) {
  62.                             $avatarbit .= "\t<tr bgcolor=\"{tableb}\" id=\"tableb\">\n";
  63.                                for ($j=0; $j<5; $j++) {
  64.                                    $avatarbit .= "\t<td align=\"center\">".$avatarArray[$count]." </td>\n";
  65.                                     $count++;
  66.                                 }
  67.                                 $avatarbit .= "\t</tr>\n";
  68.                             }
  69.                             $countall = $anzahl[0];
  70.                             $countvon = 1+25*($page-1);
  71.                             $countbis = 25*$page;
  72.                             if($countbis > $countall) $countbis = $countall;
  73.                             
  74.                             if($pages>1) {
  75.                     $page_link .= "<br>[ ";
  76.                     if($page!=1) $page_link .= "<a href=\"profile.php?mode=$mode$session&page=1\">«</a> <a href=\"profile.php?mode=$mode$session&page=".($page-1)."\">‹</a> ";
  77.                     if($page>=6) $page_link .= "<a href=\"profile.php?mode=$mode$sessionpage=".($page-5)."\">...</a> ";
  78.                     if($page+4>=$pages) $pagex=$pages;
  79.                     else $pagex=$page+4;
  80.                     for($i=$page-4 ; $i<=$pagex ; $i++) {     
  81.                         if($i<=0) $i=1;
  82.                         if($i==$page) $page_link .= $i." ";
  83.                         else $page_link .= "<a href=\"profile.php?mode=$mode$session&page=$i\">$i</a> ";
  84.                     }
  85.                     if(($pages-$page)>=5) $page_link .= "<a href=\"profile.php?mode=$mode$session&page=".($page+5)."\">...</a> ";
  86.                     if($page!=$pages) $page_link .= "<a href=\"profile.php?mode=$mode$session&page=".($page+1)."\">›</a> <a href=\"profile.php?mode=$mode$session&page=".$pages."\">»</a>";
  87.                     $page_link .= " ]";
  88.                 }
  89.                                                         
  90.                     eval ("\$avatar_choice = \"".gettemplate("profile_avatar_choice")."\";");
  91.                 }
  92.                 if($userdata[canuploadavatar]) {
  93.                     $info = $db_zugriff->query_first("SELECT * FROM bb".$n."_avatars WHERE userid = '$user_id'");
  94.                     if($info[id]) {
  95.                         $ownavatar = "<img src=\"images/avatars/avatar-".$info[id].".".$info[extension]."\">";
  96.                         $havatar = "<input type=\"hidden\" name=\"havatarid\" value=\"$info[id]\">";
  97.                         $checked2= " CHECKED";
  98.                     }
  99.                     eval ("\$avatar_choice .= \"".gettemplate("profile_avatar_useown")."\";");
  100.                 }
  101.             } 
  102.             eval("dooutput(\"".gettemplate("profile_avatars")."\");");
  103.         }
  104.         
  105.         if(!$mode) {
  106.  
  107.                 $buddylist = $db_zugriff->query("SELECT objectid, username FROM bb".$n."_object2user LEFT JOIN bb".$n."_user_table ON (bb".$n."_user_table.userid = bb".$n."_object2user.objectid) WHERE bb".$n."_object2user.userid='$user_id' AND buddylist = 1");
  108.                 while($row = $db_zugriff->fetch_array($buddylist)) {
  109.                         if(checkuseronline($row[objectid])) {
  110.                             if($online) $online .= ", ";
  111.                                 $online .= "<a href=\"members.php?mode=profile&userid=".$row[objectid]."&boardid=$boardid$session\">".$row[username]."</a>";
  112.                         } else {
  113.                             if($offline) $offline .= ", ";
  114.                                 $offline .= "<a href=\"members.php?mode=profile&userid=".$row[objectid]."&boardid=$boardid$session\">".$row[username]."</a>";
  115.                         }
  116.                 }
  117.                 
  118.                 if($pms && $userdata[canusepms]) eval ("\$profile_pmlink= \"".gettemplate("profile_pmlink")."\";");
  119.                 eval("dooutput(\"".gettemplate("profile_main")."\");");
  120.         }
  121.  
  122.         if($mode=="editprofile") {
  123.         if($send == "send") {
  124.             if(!$email || !$emailconfirm || $email != $emailconfirm || strlen($usertext) > $usertextlength || (getUserEmail($user_id) != $email && checkemail($email)) || checkemail($email,1)) eval ("\$error = \"".gettemplate("errorn1")."\";");
  125.                         else { 
  126.                             if($homepage) $homepage = editURL($homepage);
  127.                     $db_zugriff->query("UPDATE bb".$n."_user_table SET useremail='$email', userhp='$homepage', usericq='".editPostdata($icq)."', aim='".editPostdata($aim)."', yim='".editPostdata($yim)."', age_m='$month', age_d='$day', age_y='".editPostdata($year)."', location='".editPostdata($location)."', interests='".editPostdata(nt_wordwrap($interests,20))."', work='".editPostdata($work)."', gender = '$gender', usertext = '".editPostdata(nt_wordwrap($usertext,25))."' WHERE userid='$user_id'");
  128.                         }
  129.         }
  130.                                 
  131.                 $user_info = $db_zugriff->query_first("SELECT * FROM bb".$n."_user_table WHERE userid='$user_id'");
  132.                 if(!$user_info[age_d]) $day_select = "<option value=\"\" selected></option>";
  133.                 else $day_select = "<option value=\"\"></option>";
  134.         
  135.         if($user_info[usertext]) $usertext = editDBdata($user_info[usertext]);    
  136.         if($user_info[gender]==1) $gender_sel[1] = " selected";
  137.         elseif($user_info[gender]==2) $gender_sel[2] = " selected";
  138.         
  139.                 for($i = 1; $i <= 31; $i++) {
  140.                         $day_select .= "<option value=\"$i\"";
  141.                         if($user_info[age_d]=="$i") $day_select .= " selected";
  142.                         $day_select .= ">$i</option>";
  143.                 }
  144.  
  145.                 if(!$user_info[age_m]) $month_sel[0] = " selected";
  146.                 if($user_info[age_m]=="Januar") $month_sel[1] = " selected";
  147.                 if($user_info[age_m]=="Februar") $month_sel[2] = " selected";
  148.                 if($user_info[age_m]=="März") $month_sel[3] = " selected";
  149.                 if($user_info[age_m]=="April") $month_sel[4] = " selected";
  150.                 if($user_info[age_m]=="Mai") $month_sel[5] = " selected";
  151.                 if($user_info[age_m]=="Juni") $month_sel[6] = " selected";
  152.                 if($user_info[age_m]=="Juli") $month_sel[7] = " selected";
  153.                 if($user_info[age_m]=="August") $month_sel[8] = " selected";
  154.                 if($user_info[age_m]=="September") $month_sel[9] = " selected";
  155.                 if($user_info[age_m]=="Oktober") $month_sel[10] = " selected";
  156.                 if($user_info[age_m]=="November") $month_sel[11] = " selected";
  157.                 if($user_info[age_m]=="Dezember") $month_sel[12] = " selected";
  158.  
  159.         $usericq = editDBdata($user_info[usericq]);
  160.         $aim = editDBdata($user_info[aim]);
  161.         $yim = editDBdata($user_info[yim]);
  162.         $age_y = editDBdata($user_info[age_y]);
  163.         $location = editDBdata($user_info[location]);
  164.         $interests = editDBdata($user_info[interests]);
  165.         $work = editDBdata($user_info[work]);
  166.         
  167.                 eval("dooutput(\"".gettemplate("profile_editprofile")."\");");
  168.  
  169.         }
  170.  
  171.     if($mode=="editsignature") {
  172.  
  173.                 if($send && !$preview) {
  174.                     if(strlen($message) > $siglength || check_signature($message)) eval ("\$error = \"".gettemplate("errorn1")."\";");
  175.                     else $db_zugriff->query("UPDATE bb".$n."_user_table set signatur = '".editPostdata(parseURL(nt_wordwrap($message)))."' WHERE userid = '$user_id'");                
  176.                 }
  177.                 
  178.                 if($bbcode && $u_bbcode) $bbcode_buttons = getcodebuttons();
  179.         if($smilies && $u_bbcode) $bbcode_smilies = getclickysmilies(3,$anzahl_smilies);
  180.                 
  181.                 if($sightml) eval ("\$note .= \"".gettemplate("newthread_html_enable")."\";");
  182.         else eval ("\$note .= \"".gettemplate("newthread_html_disable")."\";");
  183.         if(!$sigsmilies) eval ("\$note .= \"".gettemplate("newthread_smilies_disable")."\";");
  184.         if(!$sigbbcode) eval ("\$note .= \"".gettemplate("newthread_bbcode_disable")."\";");
  185.                 
  186.                 $user_info = $db_zugriff->query_first("SELECT signatur FROM bb".$n."_user_table WHERE userid='$user_id'");
  187.                 if($user_info[signatur]) {
  188.                     $old_signature = editSignatur($user_info[signatur],0);
  189.                     eval ("\$old_signatur = \"".gettemplate("profile_old_signature")."\";");
  190.                     if(!$preview) $signature = editDBdata($user_info[signatur]);
  191.                 }
  192.                 if($preview) {
  193.                     $preview_signature = editSignatur($message,0);
  194.                     eval ("\$preview = \"".gettemplate("profile_preview_signature")."\";");
  195.                     $signature = stripslashes($message);
  196.                 
  197.                 }
  198.                 eval("dooutput(\"".gettemplate("profile_editsignature")."\");");
  199.  
  200.         }
  201.  
  202.         if($mode=="changepw") {
  203.             if($send == "send") {
  204.             
  205.                 if(!$password || !$confirmpassword || !$old_password || $password!=$confirmpassword || !checkpw($user_id,md5($old_password))) eval ("\$error = \"".gettemplate("errorn1")."\";");
  206.                     else {
  207.                         $user_password = md5($password);
  208.                             $db_zugriff->query("UPDATE bb".$n."_user_table SET userpassword='$user_password' WHERE userid='$user_id'");
  209.                             session_register("user_password");
  210.                 setcookie("user_password", "$user_password", time()+(3600*24*365));
  211.                 header("Location: profile.php?boardid=$boardid$session");
  212.                 exit;
  213.             }        
  214.                 }
  215.                 
  216.             eval("dooutput(\"".gettemplate("profile_changepw")."\");");
  217.         }
  218.         if($mode=="editoptions") {
  219.         if($send == "send") {
  220.             $db_zugriff->query("UPDATE bb".$n."_user_table SET invisible='$ghost', session_link='$slink', mods_may_email='$mod_email', users_may_email='$form_email', show_email_global='$hide_email', hide_signature='$show_signature', hide_userpic='$show_userpic', prunedays='$s_prunedays', umaxposts='$s_umaxposts', bbcode='$use_bbcode', style_set='$ustyleset' WHERE userid='$user_id'");
  221.                     header("Location: profile.php?boardid=$boardid$session");
  222.             exit;
  223.                 }
  224.                 $user = $db_zugriff->query_first("SELECT * FROM bb".$n."_user_table WHERE userid='$user_id'");
  225.                 
  226.         if($user[invisible]) $ghost[1] = "Checked";
  227.         else $ghost[0] = "Checked";
  228.         
  229.         if($user[session_link]) $slink[1] = "Checked";
  230.         else $slink[0] = "Checked";
  231.         
  232.         if($user[mods_may_email]) $mod_email[1] = "Checked";
  233.         else $mod_email[0] = "Checked";
  234.         
  235.         if($user[show_email_global]) $hide_email[1] = "Checked";
  236.         else $hide_email[0] = "Checked";
  237.         
  238.         if($user[users_may_email]) $form_email[1] = "Checked";
  239.         else $form_email[0] = "Checked";
  240.         
  241.         if($user[hide_signature]) $show_signature[1] = "Checked";
  242.         else $show_signature[0] = "Checked";
  243.         
  244.         if($user[hide_userpic]) $show_userpic[1] = "Checked";
  245.         else $show_userpic[0] = "Checked";
  246.         
  247.         if(!$user[prunedays]) $s_prunedays[0] = "selected";
  248.         if($user[prunedays]==1) $s_prunedays[1] = "selected";
  249.                 if($user[prunedays]==2) $s_prunedays[2] = "selected";
  250.                 if($user[prunedays]==5) $s_prunedays[3] = "selected";
  251.                 if($user[prunedays]==10) $s_prunedays[4] = "selected";
  252.                 if($user[prunedays]==20) $s_prunedays[5] = "selected";
  253.                 if($user[prunedays]==30) $s_prunedays[6] = "selected";
  254.                 if($user[prunedays]==45) $s_prunedays[7] = "selected";
  255.                 if($user[prunedays]==60) $s_prunedays[8] = "selected";
  256.                 if($user[prunedays]==75) $s_prunedays[9] = "selected";
  257.                 if($user[prunedays]==100) $s_prunedays[10] = "selected";
  258.                 if($user[prunedays]==365) $s_prunedays[11] = "selected";
  259.                 if($user[prunedays]==1000) $s_prunedays[12] = "selected";
  260.                 
  261.         if(!$user[umaxposts]) $s_umaxposts[0] = "selected";
  262.         if($user[umaxposts]==5) $s_umaxposts[1] = "selected";
  263.                 if($user[umaxposts]==10) $s_umaxposts[2] = "selected";
  264.                 if($user[umaxposts]==20) $s_umaxposts[3] = "selected";
  265.                 if($user[umaxposts]==30) $s_umaxposts[4] = "selected";
  266.                 if($user[umaxposts]==40) $s_umaxposts[5] = "selected";
  267.                 
  268.                 if($user[bbcode]) $use_bbcode[1] = "Checked";
  269.         else $use_bbcode[0] = "Checked";
  270.         
  271.         $style_result = $db_zugriff->query("SELECT styleid, stylename FROM bb".$n."_style WHERE default_style = 0 ORDER by stylename ASC");
  272.         while($row = $db_zugriff->fetch_array($style_result)) {
  273.             if($user[style_set]==$row[styleid]) $u_style .= "<option value=\"$row[styleid]\" selected>$row[stylename]</option>";
  274.             else $u_style .= "<option value=\"$row[styleid]\">$row[stylename]</option>";
  275.         }
  276.         $db_zugriff->free_result($style_result);
  277.          eval("dooutput(\"".gettemplate("profile_editoptions")."\");");
  278.         }
  279.  
  280.     if($mode=="buddy") {
  281.         if($send == "send" && $buddylist) {
  282.             $buddylist = explode(",",$buddylist);
  283.                 for($i = 0; $i < count($buddylist); $i++) {
  284.                     $buddylist[$i] = getUserid(trim($buddylist[$i]));
  285.                     if(!$buddylist[$i] || $buddylist[$i]==$user_id) continue;
  286.                     if(check_userobject($user_id,$buddylist[$i],"buddylist")) $db_zugriff->query("DELETE FROM bb".$n."_object2user WHERE userid = '$user_id' AND objectid = '$buddylist[$i]' AND buddylist = 1");
  287.                     else $db_zugriff->query("INSERT INTO bb".$n."_object2user (userid,objectid,buddylist) VALUES ('$user_id','$buddylist[$i]','1')");
  288.                 }
  289.         }    
  290.  
  291.                 $buddylist = $db_zugriff->query("SELECT objectid, username FROM bb".$n."_object2user LEFT JOIN bb".$n."_user_table ON (bb".$n."_user_table.userid = bb".$n."_object2user.objectid) WHERE bb".$n."_object2user.userid='$user_id' AND buddylist = 1");
  292.                 while($row = $db_zugriff->fetch_array($buddylist)) {
  293.                         if(checkuseronline($row[objectid])) {
  294.                             if($online) $online .= ", ";
  295.                                 $online .= "<a href=\"members.php?mode=profile&userid=".$row[objectid]."&boardid=$boardid$session\">".$row[username]."</a>";
  296.                         } else {
  297.                             if($offline) $offline .= ", ";
  298.                                 $offline .= "<a href=\"members.php?mode=profile&userid=".$row[objectid]."&boardid=$boardid$session\">".$row[username]."</a>";
  299.                         }
  300.                 }
  301.                 eval("dooutput(\"".gettemplate("profile_buddy")."\");");
  302.         }
  303.  
  304.     if($mode=="ignore") {
  305.         if($send == "send" && $ignorelist) {
  306.             $ignorelist = explode(",",$ignorelist);
  307.                 for($i = 0; $i < count($ignorelist); $i++) {
  308.                     $ignorelist[$i] = getUserid(trim($ignorelist[$i]));
  309.                     if(!$ignorelist[$i] || $ignorelist[$i]==$user_id) continue;
  310.                     if(check_userobject($user_id,$ignorelist[$i],"ignorelist")) $db_zugriff->query("DELETE FROM bb".$n."_object2user WHERE userid = '$user_id' AND objectid = '$ignorelist[$i]' AND ignorelist = 1");
  311.                     else $db_zugriff->query("INSERT INTO bb".$n."_object2user (userid,objectid,ignorelist) VALUES ('$user_id','$ignorelist[$i]','1')");
  312.                 }
  313.         }    
  314.  
  315.                 $ignorelist = $db_zugriff->query("SELECT objectid, username FROM bb".$n."_object2user LEFT JOIN bb".$n."_user_table ON (bb".$n."_user_table.userid = bb".$n."_object2user.objectid) WHERE bb".$n."_object2user.userid='$user_id' AND ignorelist = 1");
  316.                 while($row = $db_zugriff->fetch_array($ignorelist)) {
  317.                     if($ignoreusers) $ignoreusers .= "<br>";
  318.                     $ignoreusers .= "<a href=\"members.php?mode=profile&userid=".$row[objectid]."&boardid=$boardid$session\">".$row[username]."</a>";
  319.                 }
  320.                 eval("dooutput(\"".gettemplate("profile_ignore")."\");");
  321.         }
  322.  
  323.     if($mode=="subscripe") {
  324.         
  325.         $result = $db_zugriff->query("
  326.             SELECT
  327.             bb".$n."_object2user.objectid as boardid,
  328.             bb".$n."_boards.*,
  329.             bb".$n."_posts.threadparentid,
  330.             bb".$n."_posts.userid,
  331.             bb".$n."_posts.posttime,
  332.             bb".$n."_threads.threadname,
  333.             bb".$n."_threads.topicicon,
  334.             bb".$n."_threads.boardparentid as parentid,
  335.             bb".$n."_user_table.username    
  336.             FROM bb".$n."_object2user
  337.             LEFT JOIN bb".$n."_boards ON (bb".$n."_object2user.objectid = bb".$n."_boards.boardid)
  338.             LEFT JOIN bb".$n."_posts ON (bb".$n."_posts.postid=bb".$n."_boards.lastpostid) 
  339.             LEFT JOIN bb".$n."_threads ON (bb".$n."_threads.threadid=bb".$n."_posts.threadparentid) 
  340.             LEFT JOIN bb".$n."_user_table ON (bb".$n."_user_table.userid=bb".$n."_posts.userid) 
  341.             WHERE bb".$n."_object2user.userid = '$user_id' AND bb".$n."_object2user.favboards = 1
  342.             ORDER by boardparentid ASC, sort ASC");
  343.         while ($row = $db_zugriff->fetch_array($result)) {
  344.             if($row[invisible] && !check_boardobject($row[boardid],$user_group,"boardpermission")) continue; 
  345.             if(!$firstid) $firstid = $row[boardparentid];
  346.             $boardcache[$row[boardparentid]][$row[sort]][$row[boardid]] = $row;
  347.         }
  348.         $boardbit = makeforumbit($firstid,1,1);
  349.         $db_zugriff->free_result($result);
  350.         if($boardbit) eval ("\$subscripe_boards = \"".gettemplate("profile_subscripe_board")."\";");
  351.         
  352.         $thread_result = $db_zugriff->query("SELECT DISTINCT bb".$n."_threads.threadid, bb".$n."_threads.* FROM bb".$n."_threads, bb".$n."_object2user WHERE bb".$n."_object2user.objectid = bb".$n."_threads.threadid AND bb".$n."_object2user.userid = '$user_id' AND bb".$n."_object2user.favthreads = 1 ORDER by important DESC, timelastreply DESC");
  353.                  if($db_zugriff->num_rows($thread_result)) {
  354.                      while($threads = $db_zugriff->fetch_array($thread_result)){                        
  355.         
  356.                 unset($folder_image);
  357.                 unset($thread_link);
  358.                 unset($rate);
  359.                 unset($anonymous_lp);
  360.                 unset($anonymous);
  361.                 unset($thread_starter);
  362.                 unset($lastauthor);
  363.                 
  364.                 $sthreadname = "sthread_".$threads[threadid];    
  365.                 if($old_time <= $threads[timelastreply] && $$sthreadname < $threads[timelastreply]) $folder_image .= "new";        
  366.                 if($threads[replies] > "15" || $threads[views] > "150") $folder_image .= "hot";
  367.                 if($threads[flags]==1) $folder_image .= "lock";
  368.                 $folder_image = "<img src=\"images/".$folder_image."folder.gif\">";
  369.                 
  370.                 if($threads[topicicon]) $posticon = "<img src=\"$threads[topicicon]\">";
  371.                 else $posticon = " ";
  372.         
  373.                 if($old_time <= $threads[timelastreply] && $$sthreadname < $threads[timelastreply]) eval ("\$thread_link .= \"".gettemplate("board_gofirstnew")."\";");
  374.                 $thread_link .= "<font size=2 face=\"{font}\"><b>";
  375.                 if($threads[important]) eval ("\$thread_link .= \"".gettemplate("board_important")."\";");
  376.                 if($threads[pquestion]) eval ("\$thread_link .= \"".gettemplate("board_poll")."\";");
  377.                 $thread_link .= "<a class=\"link\" href=\"thread.php?threadid=$threads[threadid]&boardid=$threads[boardparentid]&styleid=$styleid$session\">".prepare_topic($threads[threadname])."</a></b></font>";
  378.                 if(($threads[replies]+1)/$eproseite > 1) $thread_link .= "<font size=1 face=\"$font\"> ( <img src=\"images/multipage.gif\"> <a class=\"link\" href=\"thread.php?threadid=$threads[threadid]&boardid=$threads[boardparentid]&styleid=$styleid$session&page=1\">1</a> <a class=\"link\" href=\"thread.php?threadid=$threads[threadid]&boardid=$threads[boardparentid]&styleid=$styleid$session&page=2\">2</a> ";
  379.                 if(($threads[replies]+1)/$eproseite > 2) $thread_link .= "<a class=\"link\" href=\"thread.php?threadid=$threads[threadid]&boardid=$threads[boardparentid]&styleid=$styleid$session&page=3\">3</a> ";
  380.                 if(($threads[replies]+1)/$eproseite > 3) $thread_link .= "<a class=\"link\" href=\"thread.php?threadid=".$threads[threadid]."&boardid=$threads[boardparentid]&styleid=$styleid$session&page=4\">4</a> ";
  381.                 if(($threads[replies]+1)/$eproseite > 4) {
  382.                     $pagesx=ceil(($threads[replies]+1)/$eproseite);
  383.                     eval ("\$thread_link .= \"".gettemplate("board_lastpage")."\";");
  384.                     $pages = 0;
  385.                 }
  386.                 if(($threads[replies]+1)/$eproseite > 1) $thread_link .= ")";
  387.                 eval ("\$thread_link .= \"".gettemplate("profile_subscripe_delthread")."\";");
  388.         
  389.                 $starttime = formatdate($threads[starttime],$longdateformat,1);
  390.                 if($threads[authorid]) $thread_starter = getUsername($threads[authorid]);
  391.                 else eval ("\$anonymous = \"".gettemplate("lg_anonymous")."\";");
  392.                 $lastposttime = formatdate($threads[timelastreply],$longdateformat,1);
  393.                 $lastauthorid = $db_zugriff->query_first("SELECT userid FROM bb".$n."_posts WHERE threadparentid='$threads[threadid]' ORDER by posttime DESC LIMIT 1");
  394.                 $lastauthorid = $lastauthorid[userid];
  395.                 if($lastauthorid) $lastauthor = getUsername($lastauthorid);
  396.                 else eval ("\$anonymous_lp = \"".gettemplate("lg_anonymous")."\";");
  397.         
  398.                 eval ("\$last_post = \"".gettemplate("board_lastpost")."\";");
  399.                 
  400.                 if($threads[rated] && $threads[rate_points]) {
  401.                     $j = round($threads[rate_points]/$threads[rated]);
  402.                     for ($j; $j > 0; $j--) $rate .= "<img src=\"images/star.gif\" border=0>";
  403.                 }
  404.                 else $rate = " ";
  405.         
  406.                 eval ("\$threadbit .= \"".gettemplate("board_threadbit")."\";");
  407.             }
  408.             $db_zugriff->free_result($thread_result);
  409.             eval ("\$subscripe_threads .= \"".gettemplate("profile_subscripe_thread")."\";");
  410.                  }
  411.                 
  412.                 
  413.                 eval("dooutput(\"".gettemplate("profile_subscripe")."\");");
  414.         }
  415.  
  416. } else header("LOCATION: misc.php?action=access_error&boardid=$boardid&styleid=$styleid$session");
  417. ?>
  418.  
  419.